﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">

    <!-- Fonts -->
    <link href='http://fonts.googleapis.com/css?family=Roboto:400,700&subset=latin,cyrillic,greek,vietnamese' rel='stylesheet' type='text/css'>

    <title></title>
    <link rel="shortcut icon" href="favicon.ico" />
    <link rel="stylesheet" href="css/vrs-common.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="css/vrs-desktop.css" type="text/css" media="screen" />

    <!-- [[ JS BUNDLE START ]] -->
    <!-- 3rd party javascript libraries and plugins -->
    <script src="script/jquery.js" type="text/javascript"></script>
    <script src="script/globalize.js" type="text/javascript"></script>
    <script src="script/jquery-ui.js" type="text/javascript"></script>
    <script src="script/jstorage.js" type="text/javascript"></script>

    <!-- VRS modules that are used by everything -->
    <script src="script/vrs/enums.js" type="text/javascript"></script>
    <script src="script/vrs/string.js" type="text/javascript"></script>
    <script src="script/vrs/event.js" type="text/javascript"></script>
    <script src="script/vrs/scriptManager.js" type="text/javascript"></script>
    <script src="script/vrs/serverConfiguration.js" type="text/javascript"></script>
    <script src="script/vrs/configStorage.js" type="text/javascript"></script>
    <script src="script/i18n/localise.js" type="text/javascript"></script>
    <script src="script/vrs/utility.js" type="text/javascript"></script>

    <!-- [[ BUNDLE END ]] -->
</head>
<body>
    <h1>Duplicate VRS.$$ strings:</h1>
    <table id="results">
        <tr>
            <th>Phrase</th>
            <th>Properties</th>
        </tr>
    </table>

    <script type="text/javascript">
        var VRS = window.VRS = window.VRS || {};
        VRS.globalOptions = VRS.globalOptions || {};
        jQuery(document).ready(function($) {
            VRS.globalisation.loadAndApplyState();

            /** @type {Object.<string, Array.<string>>} */
            var phrases = {};
            for(var propertyName in VRS.$$) {
                if($.isFunction(propertyName)) continue;
                var text = VRS.$$[propertyName];
                var innerArray = phrases[text];
                if(!innerArray) {
                    innerArray = [];
                    phrases[text] = innerArray;
                }
                innerArray.push(propertyName);
            }

            for(var phrase in phrases) {
                var properties = phrases[phrase];
                if(properties.length > 1) {
                    properties.sort(function(lhs, rhs) { return lhs.localeCompare(rhs); });
                    var row = $('<tr/>').appendTo($('table'));
                    $('<td/>').text(phrase).appendTo(row);
                    $('<td/>').text(properties.join(', ')).appendTo(row);
                }
            }
        });
    </script>
</body>
</html>